package net.zjitc.controller;

import net.zjitc.domain.Category;
import net.zjitc.domain.CategorySecond;
import net.zjitc.service.Impl.ServiceImpl;
import net.zjitc.service.Service;
import utils.dispacher.URLMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by Administrator on 2017/11/15.
 */
public class AdminCategorySecond {
    //显示列表
    @URLMapping(url = "/AdminCategorySecondFindAll")
    public String findAll(HttpServletRequest request, HttpServletResponse response)
    {
        Service service=new ServiceImpl();
        List<CategorySecond> allCategory = service.findAllCategorySecond();
        request.setAttribute("list",allCategory);
        return "/admin/categorysecond/list.jsp";
    }
    @URLMapping(url = "/AdminCategorySecondAddUI")
    public String addUI(HttpServletRequest request, HttpServletResponse response)
    {
        return "/admin/categorysecond/add.jsp";
    }
    @URLMapping(url = "/AdminCategorySecondAdd")
    public String add(HttpServletRequest request, HttpServletResponse response)
    {
        String url=request.getContextPath()+"/AdminCategorySecondFindAll";
        return "Redirect"+url;
    }
    @URLMapping(url = "/AdminCategorySecondEditUI")
    public String editUI (HttpServletRequest request, HttpServletResponse response)
    {
        String url=request.getContextPath()+"/AdminCategorySecondFindAll";
        return "Redirect"+url;
    }
    @URLMapping(url = "/AdminCategorySecondEdit")
    public String edit(HttpServletRequest request, HttpServletResponse response)
    {
        String url=request.getContextPath()+"/AdminCategorySecondFindAll";
        return "Redirect"+url;
    }
    @URLMapping(url = "/AdminCategorySecondDelete")
    public String delete(HttpServletRequest request, HttpServletResponse response)
    {
        String url=request.getContextPath()+"/AdminCategorySecondFindAll";
        return "Redirect"+url;
    }
}
